<template>
  <div>
    <Header />
    <div class="content" ref="content" v-html="detail.content"></div>
    <div class="recommendList">
      <div class="header">专题推荐</div>
      <div class="li" v-for="item in recommendList" :key="item.id">
        <img :src="item.scene_pic_url" alt="" />
        <p class="title">{{ item.title }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import Header from "@/components/header/header.vue";
import { topicdetail } from "@/api/topic/index.js";
export default {
  components: {
    Header,
  },
  data() {
    return {
      detail: "",
      recommendList: "",
    };
  },
  created() {
    console.log(this.$route.query.id);
    this.init();
  },
  methods: {
    async init() {
      var result = await topicdetail({
        id: this.$route.query.id,
      });
      this.detail = result.data;

      this.recommendList = result.recommendList;
      console.log(result);
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: 375px;
  /deep/ img {
    // display: block;
    width: 375px;
  }
}
.recommendList {
  .header {
    padding: 30px 0;
    text-align: center;
    font-size: 16px;
    color: #999;
  }
  .li {
    background-color: #fff;
    width: 85%;
    margin: 0 auto;
    margin-bottom: 10px;
    padding: 10px;
    img {
      width: 100%;
      height: 140px;
    }
    .title {
      font-size: 14px;
    }
  }
}
</style>>
